<?php

/**
 * AlunoTurma form base class.
 *
 * @package    form
 * @subpackage aluno_turma
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseAlunoTurmaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_aluno_turma'      => new sfWidgetFormInputHidden(),
      'id_aluno'            => new sfWidgetFormDoctrineChoice(array('model' => 'Aluno', 'add_empty' => true)),
      'id_turma_ano_letivo' => new sfWidgetFormDoctrineChoice(array('model' => 'TurmaAnoLetivo', 'add_empty' => true)),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
      'deleted'             => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_aluno_turma'      => new sfValidatorDoctrineChoice(array('model' => 'AlunoTurma', 'column' => 'id_aluno_turma', 'required' => false)),
      'id_aluno'            => new sfValidatorDoctrineChoice(array('model' => 'Aluno', 'required' => false)),
      'id_turma_ano_letivo' => new sfValidatorDoctrineChoice(array('model' => 'TurmaAnoLetivo', 'required' => false)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
      'deleted'             => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('aluno_turma[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'AlunoTurma';
  }

}
